/*
clsquare - closed loop simulation system
Copyright (c) 2004, Neuroinformatics Group, Prof. Dr. Martin Riedmiller,
University of Osnabrueck

Author: Martin Riedmiller

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.
   * Neither the name of the <ORGANIZATION> nor the names of its
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. 
*/

#ifndef _GRAPHIC_H_
#define _GRAPHIC_H_


/** Base class for all graphic modules in CLSquare */
class Graphic {
 public:
  /** Updates visualization of the environment.
   * \param state: current state. 
   * \param observation: observation of current state. 
   * \param referece_input: reference_input of plant
   * \param action: executed action in current state.
   * \param reward: reward for executing action in current state
   * \param cycle_ctr: control cycle in current episode.
   * \param episode: current episode
   * \param total_time: elapsed time since start of simulation loop.
   * \param episode_time: elapsed time since start of current episode
   * \param total_num_of_cycles: number of control cycles since start of simulation loop.
   * \return true, for success. */
  virtual bool notify(const double *state, const double *observation, const double *reference_input, 
		      const double *action, const double reward, const long cycle_ctr, const long episode, 
		      const double total_time, const double episode_time, const long total_num_of_cycles) =0;

  /** Initializes visualization of the environment.
   * \param state_dim: dimension of plant state
   * \param observation_dim: dimension of observation   
   * \param action_dim: dimension of action space.
   * \param reference_input_dim: dimension of reference input
   * \param delta_t: duration of one control cycle.
   * \param fname: file, which contains conifiguration
   * \return true, for success. */ 
  virtual bool init(int state_dim, int observation_dim, int action_dim, int _reference_input_dim, double delta_t, const char *fname=0)=0;

  /** Terminate graphics.
   * \return true for success */
  virtual bool deinit() =0; 

  /** Notifies that a command via pipe has arrived. */
  //  virtual void notfiy_command_string(char* buf){return;};
  virtual void notify_command_string(char* buf){return;};

  virtual ~Graphic(){return;};
};

#ifdef CLSQUARE
#include "registry.h"
#else
#define REGISTER_GRAPHIC(classname, desc)
#endif


#endif

